package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.AutoFill;
import com.sky.dto.EmployeeDTO;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * PROJECT_NAME: sky-take-out
 * NAME: EmployeeMapper
 * USER: SHINIAN
 * DATE: 2022/12/12
 * DESCRIPTION : B端-员工信息持久层接口
 */
@Mapper
public interface EmployeeMapper {

    /**
     * 基于员工姓名查询员工信息方法
     *
     * @param username 员工登录信息的用户名称
     * @return 查询到的员工信息（可能为NULL）
     */
    Employee selectEmployeeByUsername(@Param("username") String username);

    //新增员工基本信息 json文件
    @AutoFill(OperationType.INSERT)
    void addEmployee(@Param("employee") Employee employee);
    //员工分页查询
    Page<Employee> selectPage(@Param("employeePageQueryDTO") EmployeePageQueryDTO employeePageQueryDTO);

    //根据员工id查询
    Employee getEmployeeById(@Param("id") Long id);
    //修改员工数据v
    @AutoFill(OperationType.UPDATE)
    void updateEmp(@Param("employee") Employee employee);

}
